package com.fanshuai.mybatis_plus.domain;


import lombok.Data;

import java.util.Date;

@Data
public class UserToken {
    private long id;
    private long userId;
    private String client;

    private String accessToken;
    private String refreshToken;
    private Date expire;

    /**
     * token合法  未过期
     * @return
     */
    public boolean isValid() {
        if (null == expire) {
            return false;
        }
        Date now = new Date();
        return now.before(expire);
    }
}
